package com.mall.dto;

import com.mall.entity.PmsBrand;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
public class FrontBrandDto {
    private Long id;
    private String name;
    private String logo;
    private String bigPic;
    private String brandStory;
    private List<FrontIndexProductDto> productList;

    public void setBrand(PmsBrand brand) {
        this.id = brand.getId();
        this.name = brand.getName();
        this.logo = brand.getLogo();
        this.bigPic = brand.getBigPic();
        this.brandStory = brand.getBrandStory();
    }

    public void setProductList(List<FrontIndexProductDto> productList) {
        this.productList = new ArrayList<>();
        this.productList.addAll(productList);
    }
}
